<admintpl file="header" />
<script type="text/javascript" src="__PUBLIC__/uploadify/jquery.uploadify.min.js"></script>
<link rel="stylesheet" href="__PUBLIC__/uploadify/uploadify.css">
<style>
	.uploadList ul li{
		list-style: none;
	}
	.uploadList ul li img{
		max-height: 90px;
	}
	.field_left{
		width: 59%;
		float: left;
		margin-top: 40px;
		/*background: #D8D8D8;*/
		padding-top: 2%;
	}
	.field_left:last-child{
		width: 40%;
		margin-left: 1%;
	}
	#content{
		width: 100%;
	}
</style>
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
	        <li class="active"><a href="#A" data-toggle="tab">{:L('GENERAL_SETTING')}</a></li>
	        <!--<li><a href="#B" data-toggle="tab">{:L('SEO_SETTING')}</a></li>-->
	        <!--<li><a href="#C" data-toggle="tab">{:L('TEMPLATE_SETTING')}</a></li>-->
	    </ul>
		<form class="form-horizontal js-ajax-form" action="{:U('AdminTerm/add_post')}" method="post">
			<div class="tabbable">
		        <div class="tab-content">
		          <div class="tab-pane active" id="A">
						<fieldset>
							<div class="control-group">
								<label class="control-label">{:L('PARENT')}</label>
								<div class="controls">
									<select name="parent">
										<option value="0">{:L('ROOT')}</option>
										{$terms_tree}
									</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('NAME')}</label>
								<div class="controls">
									<input type="text" name="name" value=""><span class="form-required">*</span>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('CATEGORY_DESCRIPTION')}</label>
								<div class="controls">
									<textarea name="description" rows="5" cols="57"></textarea>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">分类图</label>
								<div class="controls">
									<div lab="uploadFile">

										<input id="image" type="file" multiple="false">
										<script type="text/javascript">
											$(function() {
												var path2 = "{$data['image']}";
												$('#image').uploadify({
													'formData'    : {          //POST数据
														'<?php echo session_name();?>' : '<?php echo session_id();?>',
													},
													'fileTypeDesc' : '上传文件',//上传描述
													'fileTypeExts' : '*.jpeg;,*.jpg;*.png,*.JPEG;,*.JPG;*.PNG',
													'swf'      : '__PUBLIC__/uploadify/uploadify.swf',
													'uploader' : "{:U('User/File/upload')}",
													'buttonText':'选择文件',
													'fileSizeLimit' : '2048KB',
													'uploadLimit' : 1,//上传文件数
													'width':90,
													'height':36,
													'successTimeout':10,//等待服务器响应时间
													'removeTimeout' : 0.2,//成功显示时间
													'onUploadSuccess' : function(file, data, response) {
														//转为json
														data=$.parseJSON(data);
														//获得图片地址
														var imageUrl = data.url;
														var li="<li path='"+data.path+"' url='"+data.url+"'><img src='__ROOT__"+imageUrl+"'/><input type='hidden' name='image' value='"+imageUrl+"'/></li>";
														$("#uploadLogoBack ul").html(li);
													}
												});
											});
										</script>
										<div id="uploadLogoBack" class="uploadList">
											<ul>
												<li path="{$data[image]}" url="{$data['image']}"><img src="{$data[image]}"/><input type='hidden' name='image' value="{$data[image]}"/>
											</ul>
										</div>
									</div>
								</div>
							</div>
							<!--<div class="control-group">-->
								<!--<label class="control-label">{:L('CATEGORY_TYPE')}</label>-->
								<!--<div class="controls">-->
									<!--<select name="taxonomy">-->
										<!--<foreach name="taxonomys" item="vo">-->
								        	<!--<option value="{$key}">{$vo}</option>-->
										<!--</foreach>-->
									<!--</select>-->
								<!--</div>-->
							<!--</div>-->
						</fieldset>
		          </div>
		          <div class="tab-pane" id="B">
						<fieldset>
							<div class="control-group">
								<label class="control-label">{:L('SEO_TITLE')}</label>
								<div class="controls">
									<input type="text" name="seo_title" value="">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('SEO_KEYWORDS')}</label>
								<div class="controls">
									<input type="text" name="seo_keywords" value="">
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('SEO_DESCRIPTION')}</label>
								<div class="controls">
									<textarea name="seo_description" rows="5" cols="57"></textarea>
								</div>
							</div>
						</fieldset>
		          </div>
		          <div class="tab-pane" id="C">
						<php>$tpl_list=sp_admin_get_tpl_file_list();</php>
						<fieldset>
							<div class="control-group">
								<label class="control-label">{:L('LIST_TEMPLATE')}</label>
								<div class="controls">
									<php>
										$list_tpls=$tpl_list;
										unset($list_tpls['list']);
									</php>
				              		<select  name="list_tpl">
				              			<option value="list">list{:C("TMPL_TEMPLATE_SUFFIX")}</option>
				              			<foreach name="list_tpls" item="vo">
				              				<option value="{$vo}">{$vo}{:C("TMPL_TEMPLATE_SUFFIX")}</option>
				              			</foreach>
				              		</select>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">{:L('ARTICLE_TEMPLATE')}</label>
								<div class="controls">
									<php>
										$article_tpls=$tpl_list;
										unset($article_tpls['article']);
									</php>
				              		<select  name="one_tpl">
				              			<option value="article">article{:C("TMPL_TEMPLATE_SUFFIX")}</option>
				              			<foreach name="article_tpls" item="vo">
				              				<option value="{$vo}">{$vo}{:C("TMPL_TEMPLATE_SUFFIX")}</option>
				              			</foreach>
				              		</select>
								</div>
							</div>
						</fieldset>
		          </div>
		        </div>
		    </div>
		    <div class="form-actions">
		     	<button class="btn btn-primary js-ajax-submit"type="submit">{:L('ADD')}</button>
		      	<a class="btn" href="javascript:history.back(-1);">{:L('BACK')}</a>
		    </div>
		</form>
	</div>
	<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
</body>
</html>